<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Module: ActionController::Integration::Runner</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Module</strong></td>
          <td class="class-name-in-header">ActionController::Integration::Runner</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../files/vendor/rails/actionpack/lib/action_controller/integration_rb.html">
                vendor/rails/actionpack/lib/action_controller/integration.rb
                </a>
        <br />
            </td>
        </tr>

        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000232">method_missing</a>&nbsp;&nbsp;
      <a href="#M000231">open_session</a>&nbsp;&nbsp;
      <a href="#M000230">reset!</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000232" class="method-detail">
        <a name="M000232"></a>

        <div class="method-heading">
          <a href="#M000232" class="method-signature">
          <span class="method-name">method_missing</span><span class="method-args">(sym, *args, &amp;block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Delegate unhandled messages to the current session instance.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000232-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000232-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/integration.rb, line 446</span>
446:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">sym</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
447:         <span class="ruby-identifier">reset!</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@integration_session</span>
448:         <span class="ruby-identifier">returning</span> <span class="ruby-ivar">@integration_session</span>.<span class="ruby-identifier">send!</span>(<span class="ruby-identifier">sym</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-keyword kw">do</span>
449:           <span class="ruby-identifier">copy_session_variables!</span>
450:         <span class="ruby-keyword kw">end</span>
451:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000231" class="method-detail">
        <a name="M000231"></a>

        <div class="method-heading">
          <a href="#M000231" class="method-signature">
          <span class="method-name">open_session</span><span class="method-args">() {|session if block_given?| ...}</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Open a new session instance. If a block is given, the new session is
yielded to the block before being returned.
</p>
<pre>
  session = open_session do |sess|
    sess.extend(CustomAssertions)
  end
</pre>
<p>
By default, a single session is automatically created for you, but you can
use this method to open multiple sessions that ought to be tested
simultaneously.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000231-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000231-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/integration.rb, line 413</span>
413:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">open_session</span>
414:         <span class="ruby-identifier">session</span> = <span class="ruby-constant">Integration</span><span class="ruby-operator">::</span><span class="ruby-constant">Session</span>.<span class="ruby-identifier">new</span>
415: 
416:         <span class="ruby-comment cmt"># delegate the fixture accessors back to the test instance</span>
417:         <span class="ruby-identifier">extras</span> = <span class="ruby-constant">Module</span>.<span class="ruby-identifier">new</span> { <span class="ruby-identifier">attr_accessor</span> <span class="ruby-identifier">:delegate</span>, <span class="ruby-identifier">:test_result</span> }
418:         <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:fixture_table_names</span>)
419:           <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">fixture_table_names</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">table_name</span><span class="ruby-operator">|</span>
420:             <span class="ruby-identifier">name</span> = <span class="ruby-identifier">table_name</span>.<span class="ruby-identifier">tr</span>(<span class="ruby-value str">&quot;.&quot;</span>, <span class="ruby-value str">&quot;_&quot;</span>)
421:             <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">name</span>)
422:             <span class="ruby-identifier">extras</span>.<span class="ruby-identifier">send!</span>(<span class="ruby-identifier">:define_method</span>, <span class="ruby-identifier">name</span>) { <span class="ruby-operator">|</span><span class="ruby-operator">*</span><span class="ruby-identifier">args</span><span class="ruby-operator">|</span> <span class="ruby-identifier">delegate</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>) }
423:           <span class="ruby-keyword kw">end</span>
424:         <span class="ruby-keyword kw">end</span>
425: 
426:         <span class="ruby-comment cmt"># delegate add_assertion to the test case</span>
427:         <span class="ruby-identifier">extras</span>.<span class="ruby-identifier">send!</span>(<span class="ruby-identifier">:define_method</span>, <span class="ruby-identifier">:add_assertion</span>) { <span class="ruby-identifier">test_result</span>.<span class="ruby-identifier">add_assertion</span> }
428:         <span class="ruby-identifier">session</span>.<span class="ruby-identifier">extend</span>(<span class="ruby-identifier">extras</span>)
429:         <span class="ruby-identifier">session</span>.<span class="ruby-identifier">delegate</span> = <span class="ruby-keyword kw">self</span>
430:         <span class="ruby-identifier">session</span>.<span class="ruby-identifier">test_result</span> = <span class="ruby-ivar">@_result</span>
431: 
432:         <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">session</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
433:         <span class="ruby-identifier">session</span>
434:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000230" class="method-detail">
        <a name="M000230"></a>

        <div class="method-heading">
          <a href="#M000230" class="method-signature">
          <span class="method-name">reset!</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Reset the current session. This is useful for testing multiple sessions in
a single test case.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000230-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000230-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/integration.rb, line 387</span>
387:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reset!</span>
388:         <span class="ruby-ivar">@integration_session</span> = <span class="ruby-identifier">open_session</span>
389:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>